package com.aaa.system.controller;

import com.aaa.entity.Menu;
import com.aaa.system.service.MenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 崔灿
 * @Date 2023/02/27 09:19
 * @ClassName RoleMenuController
 * @Description
 * @Version 1.0
 */

@Api(value = "/system/rolemenu", tags = {"角色菜单"})
@RestController
@RequestMapping("/system/rolemenu")
public class RoleMenuController {
    @Autowired
    private MenuService menuService;

    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", dataType = "int", name = "userid", value = "", required = true)
    })
    @ApiOperation(value = "", notes = "", httpMethod = "GET")
    @GetMapping("/getMenuByUserid/{userid}")
    public List<Menu> getMenuByUserid(@PathVariable Integer userid){
        return menuService.selectPermsByUserid(userid);
    }
}
